package com.kai.mqtt.config;

import com.kai.mqtt.enums.ShareStrategyEnum;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * @author weijk
 * @since 2024/6/2
 */
@Data
@ConfigurationProperties("mqtt")
public class BrokerProperties {

    /**
     * 端口
     */
    private Integer port = 1883;

    /**
     * 心跳时间（秒），该值可被客户端连接时相应配置覆盖
     */
    private Integer keepAlive = 60;

    /**
     * 最大消息字节
     */
    private Integer maxBytesInMessage = 8092;

    /**
     * 最大等待连接数量
     */
    private Integer soBacklog = 4096;

    /**
     * 共享订阅策略
     */
    private ShareStrategyEnum shareStrategy = ShareStrategyEnum.RANDOM;
}
